<!--#include file="lib/utf-8.asp"-->
<!--#include file="lib/connopen.asp"-->
<!--#include file="lib/asp-common-lib.asp"-->
<%

' if not CheckPostFlag(session("aaPostFlag"),1,3) then call JumpErrorPage(2)
Set conn_ndflow = Server.CreateObject("ADODB.CONNECTION")
db_ndflow = "DRIVER=SQLite3 ODBC Driver;Database="&Server.MapPath("ndflow.db3")
conn_ndflow.Open db_ndflow

'获取提交查询的参数
ndflowid=trim(SafeRequest("ndflowid",1))
dataday=trim(SafeRequest("dataday",0))
%>
<tr>
    <th scope="col">ID</th>
    <th scope="col">NDIP</th>
    <th scope="col">监控时间</th>
    <th scope="col">监控端口</th>
    <th scope="col">接受数据</th>
    <th scope="col">发送数据</th>
    <th scope="col">RX</th>
    <th scope="col">TX</th>
    <th scope="col">ALL</th>
    <th scope="col">CPE</th>
</tr>
<%
    if dataday="ALL" then
        sql = "select ndip,dtlog,iport,substr(ircv,1) as ircv,substr(isnt,1) as isnt,frx,ftx,icpe from ndflowlog left join ndflow on ndflowlog.ndflowid=ndflow.id where ndflow.id="&ndflowid&" order by dtLog desc"
    else
        sql = "select ndip,dtlog,iport,substr(ircv,1) as ircv,substr(isnt,1) as isnt,frx,ftx,icpe from ndflowlog left join ndflow on ndflowlog.ndflowid=ndflow.id where ndflow.id="&ndflowid&" and date(dtLog)='"&dataday&"' order by dtLog desc"
    end if
    Set rs = Server.CreateObject("ADODB.Recordset")
    rs.cursorlocation=3
    rs.Open sql,conn_ndflow,1,1
    do while not rs.eof
%>
<tr>
    <th class="sub" scope="row"><%=rs.AbsolutePosition%></th>
    <td><%=rs("ndip")%></td>
    <td><%=rs("dtlog")%></td>
    <td>
    <%
        select case rs("iport")
            case 1:response.write("同轴口")
            case 2:response.write("以太口")
        end select
    %>
    </td>
    <td><%=rs("ircv")%></td>
    <td><%=rs("isnt")%></td>
    <td><%=FormatNumber(rs("frx"),2)%></td>
    <td><%=FormatNumber(rs("ftx"),2)%></td>
    <td><%=FormatNumber(rs("ftx")+rs("frx"),2)%></td>
    <td><%=rs("icpe")%></td>
</tr>
<%
    
        rs.movenext
    loop
    rs.close
    set rs=nothing
conn_ndflow.close
set conn_ndflow=nothing
%>

<!--#include file="lib/connclose.asp"-->

